﻿#region Copyright 
/*-------------------------------------------------------------------------
* 命名空间名称/文件名:    SSPivot.Admin.Core.Service.sys.Role.Dto/SysRoleDto 
* CLR版本:     4.0.30319.42000
* 机器名称:    DESKTOP-NHMLO8A
* 功 能：       N/A
* 类 名：       SysRoleDto
* 创建时间：  2025/6/4 11:09:17
* 版本号：      v1.0
* 创建人:        xulong
*-------------------------------------------------------------------------*/
#endregion
using SSPivot.Admin.Core.Service.Dto;
using SSPivot.Admin.Core.Service.sys.Org.Dto;
using SSPivot.AspNetCore.Abstractions.User;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SSPivot.Admin.Core.Service.sys.Role.Dto
{
    /// <summary>
    /// 角色
    /// </summary>
    public class SysRoleDto : BaseTreeDto<SysRoleDto>
    {
        public long? Id { get; set; }
        /// <summary>
        /// 父级Id
        /// </summary>
        public long ParentId { get; set; }
        public string? ParentName { get; set; }

        public List<long>? ParentIds { get; set; }

        public List<string>? ParentNames { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 角色类型
        /// </summary>
        public RoleType Type { get; set; }

        /// <summary>
        /// 数据范围
        /// </summary>
        public DataScope DataScope { get; set; } = DataScope.All;

        /// <summary>
        /// 指定部门
        /// </summary>
        public long[] OrgIds { get; set; }

        public List<SysOrgDto> Orgs { get; set; }
        /// <summary>
        /// 说明
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; }
    }





    /// <summary>
    /// 角色列表响应
    /// </summary>
    public class RoleGetListDto
    {
        /// <summary>
        /// 主键
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 父级Id
        /// </summary>
        public long ParentId { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 角色类型
        /// </summary>
        public RoleType Type { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; set; }
    }

    /// <summary>
    /// 添加角色用户列表
    /// </summary>
    public class RoleAddUserListDto
    {
        /// <summary>
        /// 角色
        /// </summary>
        [Required(ErrorMessage = "请选择角色")]
        public long RoleId { get; set; }

        /// <summary>
        /// 用户
        /// </summary>
        public long[] UserIds { get; set; }
    }

    /// <summary>
    /// 角色用户列表响应
    /// </summary>
    public class RoleGetUserListDto
    {
        /// <summary>
        /// 主键Id
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        public string Mobile { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        public string Email { get; set; }
    }


    /// <summary>
    /// 角色分页响应
    /// </summary>
    public class RoleGetPageDto
    {
        /// <summary>
        /// 主键
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 说明
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 隐藏
        /// </summary>
        public bool Hidden { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime? CreatedTime { get; set; }
    }

    public class QuerySysRoleRequest
    {
        public string? Key { get; set; }
        public long? ParentId { get; set; }
        public bool ContainSelf { get; set; }
        public DateTime? SDate { get; set; }
        public DateTime? EDate { get; set; }
    }


    /// <summary>
    /// 角色用户列表请求
    /// </summary>
    public partial class QueryRoleGetUserRequset
    {
        /// <summary>
        /// 姓名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 角色Id
        /// </summary>
        public long? RoleId { get; set; }
    }


}
